/**
 * Project: push-center-biz-core
 * 
 * File Created at 2014年10月9日
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package com.greenline.push.core.pushcenter.impl;

import java.util.List;

import javax.annotation.Resource;

import com.greenline.push.core.pushcenter.AppTemplateManager;
import com.greenline.push.dal.pushcenter.AppTemplateDAO;
import com.greenline.push.dal.pushcenter.dataobject.AppTemplateDO;
import com.greenline.push.dal.query.AppTemplateQuery;

/**
 * @Type AppTemplateManagerImpl
 * @Desc
 * @author zhaoli
 * @date 2014年10月9日
 * @Version V1.0
 */
public class AppTemplateManagerImpl implements AppTemplateManager {
    @Resource
    private AppTemplateDAO appTemplateDAO;

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.greenline.push.core.pushcenter.AppTemplateManager#insert(com.greenline
     * .push.dal.pushcenter.dataobject.AppTemplateDO)
     */
    @Override
    public Long insert(AppTemplateDO appTemplate) {
        return appTemplateDAO.insert(appTemplate);
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.greenline.push.core.pushcenter.AppTemplateManager#getAppTemplateById
     * (java.lang.Long)
     */
    @Override
    public AppTemplateDO getAppTemplateById(Long id) {
        return appTemplateDAO.getAppTemplateById(id);
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.greenline.push.core.pushcenter.AppTemplateManager#update(com.greenline
     * .push.dal.pushcenter.dataobject.AppTemplateDO)
     */
    @Override
    public boolean update(AppTemplateDO appTemplate) {
        return appTemplateDAO.update(appTemplate) > 0;
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.greenline.push.core.pushcenter.AppTemplateManager#listByQuery(com
     * .greenline.push.dal.query.AppTemplateQuery)
     */
    @Override
    public AppTemplateQuery listByQuery(AppTemplateQuery query) {
        return appTemplateDAO.listByQuery(query);
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.greenline.push.core.pushcenter.AppTemplateManager#listByQuery(java
     * .lang.Long)
     */
    @Override
    public boolean delete(Long id) {
        return appTemplateDAO.delete(id) > 0;
    }

    @Override
    public List<AppTemplateDO> listByExample(AppTemplateDO appTemplateDO) {
        return appTemplateDAO.listByExample(appTemplateDO);
    }
}
